#pragma once



#include "CRasterizerEdgeStore.h"

class CMILMatrix;
class CFrameVectorBuffer;
class CPlainPen;

class CRasterizerPath
{
public: 
	CRasterizerPath();
	~CRasterizerPath();
	void SetPathData(XUINT32 cPoint, XUINT8 * pTypes, struct XPOINTF * pPoints);
	void DeletePathData();
	HRESULT GetBounds(struct XRECTF_WH * prcLocalSpaceBounds);
	HRESULT GetBounds(struct XRECTF_RB * prcLocalSpaceBounds);
	HRESULT PathForPoints(XUINT32 cPoints);
	XBOOL HasData();
	HRESULT CheckNewTransform(const CMILMatrix * pMatrix, XBOOL fPrimaryBuffer, XINT32 width, XINT32 height, XBOOL & isInside);
	HRESULT Render(CCoreServices * pCore, CFrameVectorBuffer * pFrameVectorBuffer, XFLOAT rOpacity, CLayer * pTargetLayer, CBrush * pBrush, XBOOL fBrushChanged, CPlainPen * pPen, struct IBrushSpan * pIBrushSpan, enum XcpFillMode fillMode, XBOOL fSmoothJoin, const CMILMatrix * pRenderTransform, XBOOL fUpdateEdgesWithoutAdding);
	HRESULT Render(CCoreServices * pCore, xvector<xref_ptr<CRasterizerEdgeStore> > & pFrameVectorBuffer, XFLOAT rOpacity, CLayer * pTargetLayer, CBrush * pBrush, XBOOL fBrushChanged, CPlainPen * pPen, struct IBrushSpan * pIBrushSpan, enum XcpFillMode fillMode, enum XcpShapeMaskMode fSmoothJoin, XBOOL pRenderTransform, const CMILMatrix * fUpdateEdgesWithoutAdding);
	HRESULT EnsureBasicEdgeStore(CCoreServices * pCore, CPlainPen * pPen, XBOOL fSmoothJoin, const CMILMatrix * pTransform, XFLOAT rFlattenTolerance, XBOOL fUseWidenerTransform);
	void ReleaseEdgeStore();
	CRasterizerEdgeStore * GetEdgeStore();
	XBOOL EdgeStoreHasCorrectBrushClip(CBrush * pBrush);
	HRESULT NWEnsureClipEdgeStore(struct SharedRenderParams & sharedRP, struct NWRenderParams & nwRP, CCoreServices * pCore, enum XcpFillMode fillMode);
	void NWSetOpacityAndOpacityMask(XFLOAT, CBrush *, const CMILMatrix *, struct XRECTF_WH *);
	HRESULT NWAddToFrameBuffer(CFrameVectorBuffer * pFrameVectorBuffer, XBOOL fOpacityMaskBrushChanged, XBOOL fIsLayerSharedBetweenVectorBuffers, XBOOL fIsLastAddCallForFrame, XBOOL fUpdateLayerWithoutAdding);
private: 
	HRESULT SetBasicRasterizerEdgeStore(CRasterizerEdgeStore * pRasterizerEdgeStore, CCoreServices * pCore, const CMILMatrix * pTransform, CPlainPen * pPen, XBOOL fSmoothJoin, XFLOAT rFlattenTolerance, XBOOL fUseWidenerTransform);
public: 
	struct XPOINTF * m_rgpt;
	XUINT8 * m_rgTypes;
	XUINT32 m_cPoints;
	CRasterizerEdgeStore * m_pEdgeStore;

};
